#!/bin/sh

export PATH

mount -t proc proc /proc
mount -t sysfs sysfs /sys
mount -t devtmpfs udev /dev
mkdir /dev/pts
mount -n -t devpts -o gid=5,mode=620 none /dev/pts
udevd --daemon
udevadm trigger
udevadm settle
chmod a+rx /

modprobe openvswitch_mod
/etc/init.d/openvswitch-switch start
ovs-vsctl add-br mega_bridge
ovs-vsctl set Bridge mega_bridge stp_enable=false
ovs-vsctl add-port mega_bridge eth0
ifconfig lo up
ifconfig eth0 up 0.0.0.0
dhclient -v mega_bridge

mkdir /var/run/sshd
/usr/sbin/sshd

modprobe kvm-intel

echo 32768 > /proc/sys/net/ipv4/neigh/default/gc_thresh1
echo 32768 > /proc/sys/net/ipv4/neigh/default/gc_thresh2
echo 65536 > /proc/sys/net/ipv4/neigh/default/gc_thresh3
echo 32768 > /proc/sys/net/ipv6/neigh/default/gc_thresh1
echo 32768 > /proc/sys/net/ipv6/neigh/default/gc_thresh2
echo 65536 > /proc/sys/net/ipv6/neigh/default/gc_thresh3


setsid sh -c 'exec sh </dev/tty1 >/dev/tty1 2>&1'
